package la.gs;

import la.common.CommonException;

public class GSExtractor {
	private final GSConnector connector;
	private final GSHTMLExtractor htmlExtractor;
	public GSExtractor() {
		connector = new GSConnector();
		htmlExtractor = new GSHTMLExtractor();
	}
	
	public GSDocParseResult extractFromGoogle(GSearchCriteria criteria) throws CommonException {
		return htmlExtractor.extractFromDoc( connector.search( criteria, null, null ) );
	}
	public GSDocParseResult extractFromGoogle(GSearchCriteria criteria, int firstGSResultIndex, int maxResultQty) throws CommonException {
		return htmlExtractor.extractFromDoc( connector.search( criteria, firstGSResultIndex, maxResultQty ) );
	}
	
	
}
